<template>
  <nav>
    <ul>
      <!-- 点击事件v.path  -->
      <li v-for="v in arr" :key="v.id" @click="fun(v.path)">
        <i :class="v.class"></i>
        <p>{{ v.title }}</p>
      </li>
    </ul>
  </nav>
</template>

<script>
export default {
  methods: {
    fun(path) {
      this.$router.push(path);
    },
  },
  data() {
    return {
      arr: [
        {
          id: "10001",
          class: "iconfont icon-rili",
          title: "每日推荐",
          path: "/ym",
        },
        {
          id: "10002",
          class: "iconfont icon-sirenFM",
          title: "私人FM",
          path: "/sr",
        },
        {
          id: "10003",
          class: "iconfont icon-remengedanjingangqu",
          title: "歌单",
          path: "/gd",
        },
        {
          id: "10004",
          class: "iconfont icon-paihangbang1",
          title: "排行榜",
          path: "/phb",
        },
        {
          id: "10005",
          class: "iconfont icon-radioguangbo",
          title: "直播",
          path: "/zb",
        },
        {
          id: "10006",
          class: "iconfont icon-tongbuyinle",
          title: "数字专辑",
          path: "/szzj",
        },
        {
          id: "10007",
          class: "iconfont icon-yueliang",
          title: "专注冥想",
          path: "/zzmx",
        },
        {
          id: "10008",
          class: "iconfont icon-Star",
          title: "歌房",
          path: "/gf",
        },
        {
          id: "10009",
          class: "iconfont icon-yueliang",
          title: "游戏专区",
          path: "/yxzq",
        },
      ],
    };
  },
};
</script>

<style lang="less" scoped>
nav {
  height: 1.79rem;
  background-color: white;
  padding: 0.27rem 0 0.27rem 0.32rem;
  overflow-x: scroll;
  box-sizing: border-box;
  ul {
    display: flex;
    li {
      width: 0.89rem;
      margin-right: 0.5rem;
      text-align: center;
      i {
        display: inline-block;
        padding: 0.2rem;
        border-radius: 50%;
        background: #fff1f6;
        color: #fe524b;
        margin-bottom: 0.12rem;
        &::before {
          font-size: 0.44rem;
        }
      }
      p {
        font-size: 0.2rem;
      }
    }
  }
}
/*隐藏滚动条*/
::-webkit-scrollbar {
  display: none;
}
</style>